/*
 * @Description: 请求中界面
 * @Version: V1.0.0
 * @Author: 黄鑫
 * @Date: 2025-05-19
 * @LastEditors: 黄鑫
 * @LastEditTime: 2025-05-19
 * @FilePath: LoadingView.dart
 * @Remarks: 
 */
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';

class LoadingView extends StatelessWidget {
  ///宽度
  double? width;

  ///高度
  double? height;

  ///底部颜色
  Color? baseColor;

  ///闪光颜色
  Color? highlightColor;

  ///子组件
  Widget? child;

  LoadingView({
    super.key,
    this.baseColor,
    this.highlightColor,
    this.width,
    this.height,
    this.child,
  });

  @override
  Widget build(BuildContext context) {
    return Shimmer.fromColors(
      baseColor: baseColor ?? Color(0xFFEAEAEA),
      highlightColor: highlightColor ?? Color(0xFF00D0CD),
      child: child ??
          Container(
            alignment: Alignment.center,
            width: width ?? double.infinity,
            height: height ?? double.infinity,
            child: Text(
              "加载中...",
              style: TextStyle(
                fontSize: 20.sp,
                color: Color(0xFF666666),
              ),
            ),
          ),
    );
  }
}
